package com.anlu.concurrent.ch08b.assist;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;

import com.anlu.concurrent.ch08b.vo.*;




/**
 * 生产待处理的文档
 */
public class CreatePendingDocs {

    public static List<SrcDocVo>  makePendingDoc(int count){
        Random r=new Random();

        List<SrcDocVo>  docList =new LinkedList<>();

        for (int i=0;i<count;i++){
            List<Integer>questionList =new LinkedList<Integer>();
            //每个文档中包含的题目列表
            for(int j=0;j< Consts.QUESTION_COUNT_IN_DOC;j++){
                int questionId = r.nextInt(Consts.SIZE_OF_QUESTION_BANK);
                questionList.add(questionId);
            }
            SrcDocVo pendingDocVo = new SrcDocVo("pending_"+i,
                    questionList);
            docList.add(pendingDocVo);
        }
        return docList;
    }
}
